Skip to content

[Version 12.0] Feature support for optional and parameter array params - #1623

Draft
RexJaeschke wants to merge 4 commits into
draft-v12from
v12-optional-and-parameter-array-params-feature
Draft

RexJaeschke wants to merge 4 commits into
draft-v12from
v12-optional-and-parameter-array-params-feature

Conversation

@RexJaeschke

@RexJaeschke RexJaeschke commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

This is Rex's adaptation of the corresponding MS proposal.

The MS spec has a section called "Binder changes." I did not adopt any text from there. Someone needs to review that for possible spec text changes

Note that the grammar for lambda_expression and its subordinate rules has evolved differently from the approach that various MS feature specs have used.

@RexJaeschke RexJaeschke added this to the C# 12 milestone Apr 8, 2026
@RexJaeschke RexJaeschke added type: feature This issue describes a new feature Review: pending Proposal is available for review labels Apr 8, 2026
@RexJaeschke
RexJaeschke marked this pull request as draft April 8, 2026 09:13
@BillWagner
BillWagner force-pushed the v12-optional-and-parameter-array-params-feature branch from 6fbfd50 to 0aa488a Compare May 14, 2026 15:09
@BillWagner
BillWagner force-pushed the v12-optional-and-parameter-array-params-feature branch from 0aa488a to b9548f1 Compare June 24, 2026 22:43
@BillWagner
BillWagner force-pushed the v12-optional-and-parameter-array-params-feature branch from b9548f1 to 81b39d2 Compare July 24, 2026 19:57
BillWagner pushed a commit that referenced this pull request Aug 10, 2026
…r array params

Source: #1623
PR head SHA: 81b39d2
Merge-base SHA: 2ab4487
Aggregate diff SHA-256: 5e1fa935739c50670705503b5e9abf33abc461245b19d12cdbbe1a8b516fead4
Applied: cleanly (no conflicts)
NOTE (decision 3): PR #1623 intentionally omits the 'Binder changes' section from the MS
  proposal (https://github.com/dotnet/csharplang/blob/main/proposals/csharp-12.0/lambda-method-group-defaults.md#Binder-changes).
  Per Rex's PR body: 'Someone needs to review that for possible spec text changes.'
  Flagged for committee review before alpha-v12 is finalized.
Status: REVIEW_REQUIRED — not ECMA-approved; alpha-v12 working draft only

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7c07b608-2471-41d5-845a-152b2378a43d
BillWagner pushed a commit that referenced this pull request Aug 10, 2026
Ran StandardAnchorTags (tools/StandardAnchorTags/) against alpha-v12
after applying six C# 12 feature patches (PRs #1766, #1638, #1620,
#1624, #1623, #1622). Three operations performed:

Section renumber and cross-reference update (StandardAnchorTags phases 1–2):
Resolved all 12 symbolic §-anchor headings introduced by the feature
patches to real section numbers in document order:
  §struct-prim-constructors       → §16.4  (structs.md)
  §InlineArray                    → §16.6  (structs.md)
  §declaring-a-collection-type    → §15.17 (classes.md)
  §declaring-a-collection-type-general → §15.17.1
  §collection-construction        → §15.17.2
  §prim-constructor               → §15.11.6 (classes.md)
  §InlineArrayElementAccess       → §12.8.12.3 (expressions.md)
  §collection-expressions         → §12.8.25 (expressions.md)
  §imp-collection-expression-conv → §10.2.22 (conversions.md)
  §ImplicitInlineArrayConversions → §10.2.23 (conversions.md)
  §collection-builder-attr        → §23.5.12 (attributes.md)
  §InlineArrayAttribute           → §23.5.13 (attributes.md)

Existing sections displaced by new insertions were renumbered:
  structs.md: §16.4 Record structs → §16.5; §16.5 → §16.7; §16.6 → §16.8
    (cascade: §16.6.15 safe-context-constraint → §16.8.15 throughout)
  classes.md: §15.17 Record class differences → §15.18
  expressions.md: §12.8.12.3 String access → §12.8.12.4;
                  §12.8.12.4 Indexer access → §12.8.12.5

All cross-references to displaced sections updated in: arrays.md,
attributes.md, classes.md, conversions.md, expressions.md,
interfaces.md, namespaces.md, ranges.md, structs.md, types.md,
unsafe-code.md, variables.md.

README TOC update (WriteUpdatedTOC):
standard/README.md regenerated to reflect new section numbers and
entries for all six C# 12 features. New TOC entries include §15.17
Declaring a collection type, §16.4 Primary constructors, §16.6 Inline
arrays, §10.2.22–§10.2.23, §12.8.12.3, §23.5.12–§23.5.13.

Grammar regeneration (GenerateNewGrammar):
standard/grammar.md regenerated from grammar blocks embedded in all
standard/*.md files. C# 12 grammar additions from the six feature
deltas now present:
  - collection_expression / collection_element / expression_element /
    spread_element (PR #1638, §12.8.25)
  - non_record_class_with_positional_members with delimited_parameter_list
    (PR #1766); non_record_class_without_positional_members split out
  - non_record_struct_with/without_positional_members (PR #1766)
  - class_body / struct_body / interface_body / enum_body: added
    semicolon-body alternative '| ;' (PR #1766)
  - base_argument_list moved to non-record class context; record_class_body
    and record_struct_body productions eliminated (PR #1766)
  - explicit_anonymous_function_signature simplified to
    '(' parameter_list? ')' reusing standard parameter_list (PR #1623)
  - parameter_mode_modifier uses ref_kind (PR #1624)
  - using_alias_directive: added 'unsafe'? and (namespace_name | type)
    (PR #1622); using_static_directive: added 'unsafe'? (PR #1622)
  - Source-comment section numbers updated throughout grammar.md

Eight independently reviewed manual link corrections applied to the generated
renumber output before commit (reviewed by Bill Wagner):
  - expressions.md: lower-bound inference link corrected from §12.6.3.10
    (exact inferences) to §12.6.3.11 (lower-bound inferences)
  - namespaces.md: pointer-types link corrected from attributes.md §23.3
    (attribute specification) to unsafe-code.md §24.3 (pointer types)
  - classes.md §15.16.4.6.2: symbolic §prim-constructor resolved to [§15.11.6]
  - classes.md §15.17.1: symbolic §collection-expressions resolved to [§12.8.25]
  - classes.md §15.17.1: symbolic §imp-collection-expression-conv resolved to [§10.2.22]
  - classes.md §15.17.1: symbolic §collection-builder-attr resolved to [§23.5.12]
  - classes.md §15.17.2: symbolic §collection-construction resolved to [§15.17.2]
  - classes.md §15.17.2: symbolic §declaring-a-collection-type-general resolved to [§15.17.1]

This commit does not represent ECMA approval of any feature. All six
source PRs remain open and unreviewed by the ECMA TC49-TG2 committee.
The alpha-v12 branch is a working synthesis for committee review.

Pending committee review flags (carried from feature commits):
  - expressions.md §12.6.3.14: **TBD** marker on lambda inference (PR #1638)
  - classes.md / conversions.md: PR #1623 Binder changes omitted per
    decision in session 7c07b608

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7c07b608-2471-41d5-845a-152b2378a43d
@BillWagner
BillWagner force-pushed the v12-optional-and-parameter-array-params-feature branch from 81b39d2 to 86c751b Compare September 21, 2026 23:06
BillWagner added a commit that referenced this pull request Sep 21, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bce5e82a-89fd-4655-bc08-6d6ba97f0cc6
@BillWagner
BillWagner force-pushed the v12-optional-and-parameter-array-params-feature branch from 86c751b to 7204948 Compare September 22, 2026 00:19
BillWagner added a commit that referenced this pull request Sep 22, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bce5e82a-89fd-4655-bc08-6d6ba97f0cc6
@BillWagner
BillWagner force-pushed the v12-optional-and-parameter-array-params-feature branch from 7204948 to e802807 Compare October 14, 2026 19:06
BillWagner added a commit that referenced this pull request Oct 14, 2026
[Version 12.0] Feature support for optional and parameter array params
Authoritative original head 7204948; complete ordered replay e802807.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb
RexJaeschke and others added 2 commits November 13, 2026 09:38
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
@BillWagner
BillWagner force-pushed the v12-optional-and-parameter-array-params-feature branch from e802807 to fc7d8fd Compare November 13, 2026 14:55
BillWagner added a commit that referenced this pull request Nov 13, 2026
Preserve current validated source fc7d8fd in the frozen historical active-feature order, based on finalized predecessor and current owning draft.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
BillWagner and others added 2 commits November 13, 2026 13:46
 Annex C scoped API correction

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
There were additional normative requirements needed to manage params and optional parameters on lambdas.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review: pending Proposal is available for review type: feature This issue describes a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants